package com.wowo.boy.xml;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class GirlApp {
    public static void main(String[] args) {

        //获得容器对象
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("boy/boy.xml");
        //获得女孩对象
        Girl jgirl = applicationContext.getBean(JapanGirl.class);
        jgirl.Kiss();
        Girl kgirl = applicationContext.getBean(KoreaGirl.class);
        kgirl.Kiss();

        Boy boy = (Boy) applicationContext.getBean("boy");
        System.out.println(boy);
        boy.getGirl().Kiss();
        Boy boy1 = (Boy) applicationContext.getBean("boy1");
        System.out.println(boy1);
        boy1.getGirl().Kiss();
        //调用对象上的方法
    }
}
